﻿@{
    ViewBag.Title = "Login";
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>登录页面</title>
    <meta name="author" content="DeathGhost" />
    <link rel="stylesheet" type="text/css" href="~/Login_Master/css/style.css" tppabs="css/style.css" />
    <style>
        body {
            height: 100%;
            background: #16a085;
            overflow: hidden;
        }

        canvas {
            z-index: -1;
            position: absolute;
        }
    </style> 

    <script src="~/Scripts/jquery-1.8.2.min.js"></script>

    <script src="~/js/jquery.min.js"></script>
    <script src="~/js/bootstrap.min.js"></script>
    <script src="~/Login_Master/js/jquery.js"></script>
    <script src="~/Login_Master/js/verificationNumbers.js"></script>
    <script src="~/Login_Master/js/Particleground.js"></script>
    <script>
        $(document).ready(function () {
            //粒子背景特效
            $('body').particleground({
                dotColor: '#5cbdaa',
                lineColor: '#5cbdaa'
            });
            //验证码
            createCode();
            //测试提交，对接程序删除即可
            $(".submit_btn").click(function () {
                location.href = "javascrpt:;"/*tpa=http://***index.html*/;
            });
        });
    </script>
</head>
<body>

    <dl class="admin_login">
        <dt>
            <strong>地产评估系统</strong>
            <em>Personnel Management </em>
        </dt>
        <dd class="user_icon">
            <input type="text" placeholder="账号" id="name" name="name" class="login_txtbx" />
        </dd>
        <dd class="pwd_icon">
            <input type="password" placeholder="密码" id="pwd" name="pwd" class="login_txtbx" />
        </dd>
        <dd>
            <input type="button" value="立即登陆" class="submit_btn" onclick="UsersLogin()" />
    
        </dd>
        <dd><input type="button" value="立即注册" class="submit_btn" onclick="UsersRes()" /></dd>
        <dd>
            <p>适用浏览器：360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下浏览器。</p>
            <p>来源：<a href="http://sc.chinaz.com/" target="_blank">站长素材</a></p>
        </dd>
       

    </dl>

</body>
</html>

<script>

    function UsersLogin() {
        var name = $("#name").val();
        var pwd = $("#pwd").val();


        $.ajax({
            type: "get",
            url: "http://localhost:63805/apis/Users/uselogin",
            data: { Users_Account: name, users_Pwd: pwd },
            success: function (o) {
                
                if (o==null) {
                    alert("登陆失败");
                }
                else {
                    localStorage.setItem("name", o.users_Name);
                    localStorage.setItem("role", o.Roles_id);
                    localStorage.setItem("id", o.users_Id);
                    location.href = '/Home/Index';
                }
             }
        })
    }

    function UsersRes()
    {
        location.href = '/Home/UsersRees';
    }

</script>
